<?php

namespace JsonLowCode\UI;

use JsonLowCode\Schema;
use JsonLowCode\Traits\Props\HasBordered;
use JsonLowCode\Traits\Props\HasDisplayDirective;
use JsonLowCode\Traits\Props\HasHeight;
use JsonLowCode\Traits\Props\HasModelValue;
use JsonLowCode\Traits\Props\HasTitle;
use JsonLowCode\Traits\Props\HasWidth;

/**
 * modal 弹窗组件
 * @method static Modal make(string $title = "",mixed $children = null) modal 弹窗组件
 */
class Modal extends Schema
{
    protected string $componentName = "AppModal";

    use HasTitle, HasModelValue, HasBordered, HasHeight, HasWidth, HasDisplayDirective;

    protected bool $fullscreen = true;
    protected bool $draggable = false;

    protected array $class = ['app-modal'];

    protected array $styles = [];

    protected ?Scrollbar $scrollbar = null;

    protected ?Element $modalContent = null;

    /**
     * @param string $title
     * @param mixed|null $children
     */
    public function __construct(string $title = "",mixed $children = null)
    {
        parent::__construct();
        $this->title($title);
        $this->children($children);
    }
}
